package icedot.library.common.utils.struct;

public class SysVersionInfo 
{
	private String 		_phoneType;			//机型
	private int 		_androidSDK;		//安卓版本号
	private String 		_androidRelease;	//系统版本编号
	
	private AppVersionInfo _nowApk;			//当前程序的版本信息
	
	private int 		_updateCode;		//更新的程序编号
	private String 		_updateVersion;		//获取的更新版本
	private String 		_updateUrl;			//地址
	private String 		_updateInfo;		//信息
	private int 		_minVersion;		//支持的最低版本
	private String 		_updateSize;		//更新的包大小M为单位
	private int 		_isForceUpdate = 0;	//服务器指定是否强制更新
	
	public SysVersionInfo()
	{
		_nowApk = new AppVersionInfo();
	}
	
	public String getPhoneType() {
		return _phoneType;
	}
	public String getAndroidVer() 
	{
		switch(_androidSDK)
		{
		case 1:
			return "android1.0";
		case 2:
			return "android1.1";
		case 3:
			return "android1.5";
		case 4:
			return "android1.6";
		case 5:
			return "android2.0";
		case 6:
			return "android2.0.1";
		case 7:
			return "android2.1";
		case 8:
			return "android2.2";
		case 9:
			return "android2.3";
		case 10:
			return "android2.3.3";
		case 11:
			return "android3.0";
		case 12:
			return "android3.1";
		case 13:
			return "android3.2";
		case 14:
			return "android4.0";
		case 15:
			return "android4.0.3";
		case 16:
			return "android4.1.2";
		case 17:
			return "android4.2.2";
		case 18:
			return "android4.3";
		case 19:
			return "android4.4";
		default:
			return "unkwon sys";
		}
	}
	public void setIsForceUpdate(int force)
	{
		_isForceUpdate = force;
	}
	public int getAndroidSDK() {
		return _androidSDK;
	}
	public String getAndroidRelease() {
		return _androidRelease;
	}
	public int getAppCode() {
		return _nowApk.Code;
	}
	public String getAppVersion() {
		return _nowApk.Version;
	}
	public String getAppPackName() {
		return _nowApk.PackageName;
	}
	public void setPhoneType(String _phoneType) {
		this._phoneType = _phoneType;
	}
	public void setAndroidSDK(int _androidSDK) {
		this._androidSDK = _androidSDK;
	}
	public void setAndroidRelease(String _androidRelease) {
		this._androidRelease = _androidRelease;
	}
	public void setAppCode(int _appCode) {
		_nowApk.Code = _appCode;
	}
	public void setAppVersion(String _appVersion) {
		_nowApk.Version = _appVersion;
	}
	public void setAppPackName(String _appPackeName) {
		_nowApk.PackageName = _appPackeName;
	}
	public String getUpdateVersion() {
		return _updateVersion;
	}
	public String getUpdateUrl() {
		return _updateUrl;
	}
	public String getUpdateInfo() {
		return _updateInfo;
	}
	public int getMinVersion() {
		return _minVersion;
	}
	public void setUpdateVersion(String _updateVersion) {
		this._updateVersion = _updateVersion;
	}
	public void setUpdateUrl(String _updateUrl) {
		this._updateUrl = _updateUrl;
	}
	public void setUpdateInfo(String _updateInfo) {
		this._updateInfo = _updateInfo;
	}
	public void setMinVersion(int minVersion) {
		this._minVersion = minVersion;
	}
	
	public int getUpdateCode() {
		return _updateCode;
	}
	public void setUpdateCode(int _updateCode) {
		this._updateCode = _updateCode;
	}
	public boolean needUPdate()
	{
		if(_nowApk.Code < _minVersion || _updateCode != _nowApk.Code)
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	public String getUpdateSize() {
		return _updateSize;
	}
	public void setUpdateSize(String _updateSize) {
		this._updateSize = _updateSize;
	}
	public boolean isUpdateForce()
	{
		if(_nowApk.Code < _minVersion || _nowApk.Code > _updateCode)
		{
			return true;
		}
		else
		{
			if(_isForceUpdate == 1)
			{
				return true;
			}
			return false;
		}
	}
}
